package com.tz.colawallet.ui.presenter;

import com.tz.colawallet.basecode.base.BaseBiz;
import com.tz.colawallet.bean.UserInfo;
import com.tz.colawallet.ui.biz.MainBiz;
import com.tz.colawallet.ui.contract.MainContract;

import javax.inject.Inject;

/**
 * Created by Administrator on 2017/10/25.
 */

public class MainPresenter implements MainContract.MainPresenter {

    MainContract.View view;
    MainBiz mainBiz;

    @Inject
    public MainPresenter(MainContract.View view) {
        this.view = view;
    }


    @Override
    public void setBiz(BaseBiz biz) {
        mainBiz = (MainBiz) biz;
    }


    @Override
    public void login() {

//        view.loading(true);
        mainBiz.Login("9453eaa008524a665ac51c08e4d68273", "18120689985704", "XIAOFANG", "LEVEL_1", new BaseBiz.Callback<UserInfo>() {
            @Override
            public void onSuccess(UserInfo info) {
//                view.loading(false);
                System.out.println("UserInfo--->" + info.getUser().toString());
            }

            @Override
            public void onFailure(UserInfo info) {
//                view.loading(false);
            }
        });
    }

}
